from dataclasses import dataclass, field
from typing import ClassVar

import helpers
from timerange import TimeRange


@dataclass
class Friend:
    all_busy_minutes_range: ClassVar[list] = []
    name: str
    busy_time_ranges: list[TimeRange] = field(default_factory=list, repr=False)

    def add_busy_range(self, obj:TimeRange):
        self.busy_time_ranges.append(obj)
        # Add the minutes range to a class atribute
        Friend.all_busy_minutes_range.append(obj.minutes_range)
